package com.cs.study.homework._0311.TestTCP;

import java.io.*;
import java.net.Socket;
import java.util.Scanner;

public class Client {
    public static void main(String[] args) throws IOException {
        //创建客户点socket对象
        Socket socket = new Socket("192.168.106.110", 4567);

        Scanner sc = new Scanner(System.in);
        String s = sc.nextLine();
        //从socket中获取输入输出流
        InputStream in = socket.getInputStream();
        OutputStream out = socket.getOutputStream();

        //利用输出输出流进行读写操作
        out.write(s.getBytes());
        //释放资源close

        socket.close();
    }
}
